#主动技能【视界交换】
#在自身位置释放zuozhu1盔甲架
summon minecraft:armor_stand ~ ~ ~ {Tags: [zuozhu1], Marker: 1b, CustomNameVisible: 0b, Invulnerable: 1b, PersistenceRequired: 1b, NoGravity: 1b, OnGround: 1b, Invisible: 1, Small: 1, NoBasePlate: 1, Rotation: [0f]}

#在目标位置释放zuozhu2盔甲架
execute positioned ^ ^ ^20 at @e[distance=0..3.5,limit=1,sort=nearest] run summon minecraft:armor_stand ~ ~ ~ {Tags: [zuozhu2], Marker: 1b, CustomNameVisible: 0b, Invulnerable: 1b, PersistenceRequired: 1b, NoGravity: 1b, OnGround: 1b, Invisible: 1, Small: 1, NoBasePlate: 1, Rotation: [0f]}
execute positioned ^ ^ ^20 unless entity @e[distance=0..3.5] positioned ^ ^ ^-5 at @e[distance=0..3.5,limit=1,sort=nearest] run summon minecraft:armor_stand ~ ~ ~ {Tags: [zuozhu2], Marker: 1b, CustomNameVisible: 0b, Invulnerable: 1b, PersistenceRequired: 1b, NoGravity: 1b, OnGround: 1b, Invisible: 1, Small: 1, NoBasePlate: 1, Rotation: [0f]}
execute positioned ^ ^ ^20 unless entity @e[distance=0..3.5] positioned ^ ^ ^-5 unless entity @e[distance=0..3.5] positioned ^ ^ ^-5 at @e[distance=0..3.5,limit=1,sort=nearest] run summon minecraft:armor_stand ~ ~ ~ {Tags: [zuozhu2], Marker: 1b, CustomNameVisible: 0b, Invulnerable: 1b, PersistenceRequired: 1b, NoGravity: 1b, OnGround: 1b, Invisible: 1, Small: 1, NoBasePlate: 1, Rotation: [0f]}
execute positioned ^ ^ ^20 unless entity @e[distance=0..3.5] positioned ^ ^ ^-5 unless entity @e[distance=0..3.5] positioned ^ ^ ^-5 unless entity @e[distance=0..3.5] positioned ^ ^ ^-5 at @e[distance=0..4.9,limit=1,sort=nearest] run summon minecraft:armor_stand ~ ~ ~ {Tags: [zuozhu2], Marker: 1b, CustomNameVisible: 0b, Invulnerable: 1b, PersistenceRequired: 1b, NoGravity: 1b, OnGround: 1b, Invisible: 1, Small: 1, NoBasePlate: 1, Rotation: [0f]}

#将自身的禁锢与眩晕属性赋予给盔甲架
execute as @e[type=armor_stand,tag=zuozhu1,limit=1,sort=nearest] at @s run scoreboard players operation @s EFLock = @a[tag=qiaoyisi,sort=nearest,limit=1] EFLock
scoreboard players operation @e[type=armor_stand,tag=zuozhu1,limit=1,sort=nearest] EFLock *= 系统倒数 skPlayer
execute as @e[type=armor_stand,tag=zuozhu1,limit=1,sort=nearest] at @s run scoreboard players operation @s EFDizzy = @a[tag=qiaoyisi,sort=nearest,limit=1] EFDizzy
scoreboard players operation @e[type=armor_stand,tag=zuozhu1,limit=1,sort=nearest] EFDizzy *= 系统倒数 skPlayer

execute as @e[type=armor_stand,tag=zuozhu2] at @s run scoreboard players operation @s EFLock = @e[sort=nearest,limit=1] EFLock
scoreboard players operation @e[type=armor_stand,tag=zuozhu2] EFLock *= 系统倒数 skPlayer
execute as @e[type=armor_stand,tag=zuozhu2] at @s run scoreboard players operation @s EFDizzy = @e[sort=nearest,limit=1] EFDizzy
scoreboard players operation @e[type=armor_stand,tag=zuozhu2] EFDizzy *= 系统倒数 skPlayer



execute positioned ^ ^ ^20 as @e[distance=0..3.5,limit=1,sort=nearest] at @e[type=armor_stand,tag=zuozhu1,limit=1,sort=nearest] run tp @s ~ ~ ~

execute positioned ^ ^ ^20 unless entity @e[distance=0..3.5] positioned ^ ^ ^-5 as @e[distance=0..3.5,limit=1,sort=nearest] at @e[type=armor_stand,tag=zuozhu1,limit=1,sort=nearest] run tp @s ~ ~ ~

execute positioned ^ ^ ^20 unless entity @e[distance=0..3.5] positioned ^ ^ ^-5 unless entity @e[distance=0..3.5] positioned ^ ^ ^-5 as @e[distance=0..3.5,limit=1,sort=nearest] at @e[type=armor_stand,tag=zuozhu1,limit=1,sort=nearest] run tp @s ~ ~ ~

execute positioned ^ ^ ^20 unless entity @e[distance=0..3.5] positioned ^ ^ ^-5 unless entity @e[distance=0..3.5] positioned ^ ^ ^-5 unless entity @e[distance=0..3.5] positioned ^ ^ ^-5 as @e[distance=0..3.5,limit=1,sort=nearest] at @e[type=armor_stand,tag=zuozhu1,limit=1,sort=nearest] run tp @s ~ ~ ~

execute positioned ^ ^ ^20 unless entity @e[distance=0..3.5] positioned ^ ^ ^-5 unless entity @e[distance=0..3.5] positioned ^ ^ ^-5 unless entity @e[distance=0..3.5] positioned ^ ^ ^-5 unless entity @e[distance=0..3.5] positioned ^ ^ ^-5 as @e[distance=0..4.9,limit=1,sort=nearest] at @e[type=armor_stand,tag=zuozhu1,limit=1,sort=nearest] run tp @s ~ ~ ~

execute at @e[type=armor_stand,tag=zuozhu2,limit=1,sort=nearest] run tp @s ~ ~ ~ facing entity @e[type=armor_stand,tag=zuozhu1,limit=1,sort=nearest] feet

#交换数值
execute as @e[type=armor_stand,tag=zuozhu1,limit=1] at @s run scoreboard players operation @p EFLock = @s EFLock
execute as @e[type=armor_stand,tag=zuozhu1,limit=1] at @s run scoreboard players operation @p EFDizzy = @s EFDizzy
execute as @e[type=armor_stand,tag=zuozhu2,limit=1] at @s run scoreboard players operation @p EFLock = @s EFLock
execute as @e[type=armor_stand,tag=zuozhu2,limit=1] at @s run scoreboard players operation @p EFDizzy = @s EFDizzy

kill @e[type=armor_stand,tag=zuozhu1]
kill @e[type=armor_stand,tag=zuozhu2]

tellraw @a [{"selector":"@s","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"：释放技能","color":"blue","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"【视界交换】","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"—乔伊斯","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
scoreboard players remove @s skPlayer 15
execute if score @s skPlayer matches ..0 run effect give @s minecraft:instant_damage 1 0
scoreboard players set @s skCDEgg 10
scoreboard players set @s skEgg 0